var myDocument = app.activeDocuments;
var myPage = myDocument.pages.item(0);
myTextFrame= myPage.textFrames.item(0);
myTextFrame.contents = myPage.pageReference.add(pageReferenceType);